package com.specter.serv.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.specter.mvc.model.Request;
import com.specter.mvc.model.Response;
import com.specter.serv.service.AcisService;

import lombok.extern.slf4j.Slf4j;

/**
 * 用户部门平台公共接口
 * 
 * @author liangthink
 * @date 2025-06-10
 */
@Slf4j
@RestController("serv-acis")
@RequestMapping("/serv/acis")
public class AcisController {
    private @Autowired AcisService supported;

    /**
     * 数据共享部门查询
     * 
     * @param type    查询类型(list/page)
     * @param request 查询条件
     * @return 查询结果
     */
    @RequestMapping("/dept/{type}")
    public Response dept(@PathVariable String type, @RequestBody(required = false) Request request) {
        Object data = supported.dept(type, request);
        return Response.success().data(data);
    }

    /**
     * 数据共享用户查询
     * 
     * @param type    查询类型(list/page)
     * @param request 查询条件
     * @return 查询结果
     */
    @RequestMapping("/user/{type}")
    public Response user(@PathVariable String type, @RequestBody(required = false) Request request) {
        Object data = supported.user(type, request);
        return Response.success().data(data);
    }

    /**
     * 数据共享用户查询
     * 
     * @param type    查询类型(list/page)
     * @param request 查询条件
     * @return 查询结果
     */
    @RequestMapping("/prop/{type}")
    public Response prop(@PathVariable String type, @RequestBody(required = false) Request request) {
        Object data = supported.prop(type, request);
        return Response.success().data(data);
    }
}
